package com.qili.service.sys.impl;

import com.qili.base.mapper.BaseMapper;
import com.qili.base.service.impl.BaseServiceImpl;
import com.qili.entity.sys.SysRegion;
import com.qili.mapper.sys.SysRegionMapper;
import com.qili.service.sys.SysRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhaoyongke
 * @date 2020/10/23
 * @description
 */
@Service
public class SysRegionServiceImpl extends BaseServiceImpl<SysRegion, String> implements SysRegionService {
    @Autowired
    private SysRegionMapper sysRegionMapper;


    @Override
    public BaseMapper<SysRegion, String> getMappser() {
        return sysRegionMapper;
    }

    public List<SysRegion> selectSysRegionByParentCode(String code) {
        return sysRegionMapper.selectSysRegionByParentCode(code);
    }

    public List<SysRegion> selectListByParentId(Long parentid) {
        List<SysRegion> list = sysRegionMapper.selectListByParentid(parentid);
        return list;
    }


    public List<SysRegion> selectListByLevelId(String levelid) {
        List<SysRegion> list = sysRegionMapper.selectListByLevelId(levelid);
        return list;
    }
    @Override
    public  SysRegion selectRegionBycode(String code){
        SysRegion sysRegion = sysRegionMapper.selectRegionBycode(code);
        return sysRegion;
    }
}
